API Documentation
Public Member Functions | Public Attributes | List of all members
nkGraphics::VertexComposition Class Referencefinal

Holds information about the composition of a mesh : the data it offers. More...

Public Member Functions

 VertexComposition ()
 
 VertexComposition (bool position, bool color, bool uv, bool normal, bool tangent, bool binormal)
 
 ~VertexComposition ()
 
unsigned short getAsShort () const
 
std::string getAsString () const
 
const InfiniteByteMaskgetAsMask () const
 
unsigned short getAttributeNumber () const
 
unsigned short getTotalComponentNumber () const
 
unsigned short getTotalByteSize () const
 
unsigned short getVertexPerPrimitive () const
 
unsigned short getComponentPerFormat (FORMAT format) const
 
void refreshBitMask ()
 
bool operator== (const VertexComposition &other) const
 
bool operator< (const VertexComposition &other) const
 

Public Attributes

FORMAT _positionFormat
 The format of positions.
 
FORMAT _colorFormat
 The format of colors.
 
FORMAT _uvFormat
 The format of texture coordinates.
 
FORMAT _normalFormat
 The format of normals.
 
FORMAT _tangentFormat
 The format of tangents.
 
FORMAT _binormalFormat
 The format of binormals.
 
PRIMITIVE_TOPOLOGY _topology
 The topology of the mesh.
 
bool _position
 Wether the mesh exposes positions.
 
bool _color
 Wether the mesh exposes colors.
 
bool _uv
 Wether the mesh exposes texture coordinates.
 
bool _normal
 Wether the mesh exposes normals.
 
bool _tangent
 Wether the mesh exposes tangents.
 
bool _binormal
 Wether the mesh exposes binormals.
 

Detailed Description

Holds information about the composition of a mesh : the data it offers.

Constructor & Destructor Documentation

◆ VertexComposition() [1/2]

nkGraphics::VertexComposition::VertexComposition ( )

Default constructor.

◆ VertexComposition() [2/2]

nkGraphics::VertexComposition::VertexComposition ( bool  position,
bool  color,
bool  uv,
bool  normal,
bool  tangent,
bool  binormal 
)

Filling constructor.

Parameters
positionIf the composition exposes positions.
colorIf the composition exposes colors.
uvIf the composition exposes uvs.
normalIf the composition exposes normals.
tangentIf the composition exposes tangents.
binormalIf the composition exposes binormals.

◆ ~VertexComposition()

nkGraphics::VertexComposition::~VertexComposition ( )

Destructor.

Member Function Documentation

◆ getAsShort()

unsigned short nkGraphics::VertexComposition::getAsShort ( ) const
Returns
The composition as a short. Used for internal tracking of layouts.

◆ getAsString()

std::string nkGraphics::VertexComposition::getAsString ( ) const
Returns
The format described in a string. Useful for logging.

◆ getAsMask()

const InfiniteByteMask& nkGraphics::VertexComposition::getAsMask ( ) const
Returns
The bit mask linked.

◆ getAttributeNumber()

unsigned short nkGraphics::VertexComposition::getAttributeNumber ( ) const
Returns
The number of attributes (position, color...) in the composition.

◆ getTotalComponentNumber()

unsigned short nkGraphics::VertexComposition::getTotalComponentNumber ( ) const
Returns
The total number of components (xyz, rgb...) the attributes expose.

◆ getTotalByteSize()

unsigned short nkGraphics::VertexComposition::getTotalByteSize ( ) const
Returns
The total size, in byte, needed for a vertex.

◆ getVertexPerPrimitive()

unsigned short nkGraphics::VertexComposition::getVertexPerPrimitive ( ) const
Returns
The number of vertices per primitive, for given topology.

◆ getComponentPerFormat()

unsigned short nkGraphics::VertexComposition::getComponentPerFormat ( FORMAT  format) const
Returns
The number of components (xyz...) per format.

◆ refreshBitMask()

void nkGraphics::VertexComposition::refreshBitMask ( )

Refreshes the bit mask. Updated when a mesh is loading, used for layout tracking.

◆ operator==()

bool nkGraphics::VertexComposition::operator== ( const VertexComposition other) const

Equality operator.

Parameters
otherThe composition to compare with.
Returns
Whether both composition are the same (true) or not (false).

◆ operator<()

bool nkGraphics::VertexComposition::operator< ( const VertexComposition other) const

Less than operator.

Parameters
otherThe composition to compare with.
Returns
Whether the composition is "smaller" (true) or not (false).
Remarks
Used for indexing. There is no real meaning to this operator, apart from ordering them.

The documentation for this class was generated from the following file: